import 'package:flutter/material.dart';

class SnackBarDemoState extends State<SnackBarDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('SnackBarDemo'),
        elevation: 0.0,
      ),
      body: Container(
        padding: EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[SnackBarButton()],
        ),
      ),
    );
  }
}

class SnackBarButton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return FlatButton(
      onPressed: () {
        Scaffold.of(context).showSnackBar(SnackBar(
          content: Text('showSnackBar process...'),
          action: SnackBarAction(label: 'OK', onPressed: () {}),
        ));
      },
      child: Text('showSnackBar'),
      textColor: Colors.white,
      color: Colors.blue,
    );
  }
}

class SnackBarDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => SnackBarDemoState();
}
